package 对象的使用;

public class Human {
    private String name ;
    private int age;
    private double salary;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    /**
     *
     * @param name 食物的名称
     * @return 食物
     */
    public Food cooking(String name){
        return new Food(name );
    }

    /**
     * 吃饭
     * @param food
     */
    public String eat(Food food){
       String str= food.sub();
       return name +","+str;

    }
}
